/**
 * @file skoll.actions.sidetools.search.js
 * @author Alejandro Dario Simi
 * @date $Date: 2014-06-03 03:40:32 +0000 (Tue, 03 Jun 2014) $
 *
 * $Id: skoll.actions.sidetools.search.js 112 2014-06-03 03:40:32Z daemonraco@gmail.com $
 * $URL: http://wcomix.googlecode.com/svn/trunk/skins/Skoll/js/skoll.actions.sidetools.search.js $
 */

Skoll.actions.sidetools.search = {
	//
	// Protected properties.
	// 
	// Public methods.
	query: function(form) {
		Skoll.tools.preventDefault();

		document.location.href = "?action=content:query&group=" + GROUP_ID + "&query=" + escape($(form).find("#QueryPattern").val()) + Skoll.tools.extraUrlParams();
	},
	search: function(form) {
		Skoll.tools.preventDefault();

		var type = $(form).find("#SearchType").val();
		var url = "?action=content:search&group=" + GROUP_ID + "&pattern=" + $(form).find("#SearchPattern").val() + Skoll.tools.extraUrlParams();

		if (type != "") {
			url += "&O-" + type + "=on";
		}

		document.location.href = url;
	},
	setPattern: function(pattern) {
		$("#SearchPattern").val(pattern);
	},
	setQueryPattern: function(pattern) {
		$("#QueryPattern").val(pattern);
	}
};